<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>async await</title>
</head>

<body>

</body>
<script>
    function timeout(ms) {
        return new Promise((resolve) => {
            setTimeout(resolve, ms);
        });
    }
    async function asyncFunction(value, ms) {
        await timeout(ms);
        console.log(value);
    }
    asyncFunction('hello world', 5000);
</script>

</html>